// pages/jkhuibao/jkhuibao.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    activeIndex:1,
    toView:2,
    showClass: false,//是否显示选择标签面板
    navlist: [{
      id: 0,
      name: "关注",
    },
    {
      id: 1,
      name: "推荐",
    },
    {
      id: 2,
      name: "营养保健",
    }, {
      id: 3,
      name: "招聘求职",
    }, {
      id: 4,
      name: "美容护肤",
      }, {
        id: 5,
        name: "个人洗护",
      }, {
        id:6,
        name: "家居收纳",
      }, {
        id: 7,
        name: "出行",
      }],
      shoplist:[{
        shopid:1,
        logo:"/pages/images/pin1.png",
        shopname:"御泥坊",
        date:"2018.2.10",
        content:"关于店铺的简介，关于店铺的简介，关于店铺的简介,关于店铺的简介，关于店铺的简介，关于店铺的简介",
        picurl: ["/pages/images/pic0.png", "/pages/images/pic0.png", "/pages/images/pic0.png"]
      },{
          shopid: 2,
          logo: "/pages/images/pin2.png",
          shopname: "the Face Shop",
          date: "2018.5.10",
          content: "关于店铺的简介，关于店铺的简介，关于店铺的简介",
          picurl: ["/pages/images/pic0.png", "/pages/images/pic0.png", "/pages/images/pic0.png", 
          "/pages/images/pic0.png", "/pages/images/pic0.png", "/pages/images/pic0.png"]
      },{
          shopid: 3,
          logo: "/pages/images/pin1.png",
          shopname: "the Face Shop",
          date: "2018.5.10",
          content: "关于店铺的简介，关于店铺的简介，关于店铺的简介,关于店铺的简介，"+
          "关于店铺的简介，关于店铺的简介,关于店铺的简介，关于店铺的简介，关于店铺的简介",
          picurl: ["/pages/images/pic0.png"]
      }]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
      var that=this;
      var options=options;

  },
  /*******选择类别**********/
  choseNav:function(e){
      console.log(e);
      var that=this;
      // var offsetX = e.detail.x;
      var activeIndex=e.currentTarget.dataset.index;
      that.setData({
        activeIndex:activeIndex,
        toview: "item"+activeIndex
      })
      that.loading();
  
    
    
   
    
  },
  loading:function(){
    wx.showLoading();
    setTimeout(function(){
      wx.hideLoading()
    },500)
  },
  /***********点击按钮显示更多标签************ */
  getmore:function(){
    var that = this;
    that.setData({
      showClass: true
    }) 
  },
  //选择标签
  choseClass:function(e){
    var that = this;
    var activeIndex = e.currentTarget.dataset.index;
    var activeId=e.currentTarget.dataset.id;//传值用
    that.setData({
      activeIndex: activeIndex,
      toview: "item" + activeIndex
    })
    
    setTimeout(function () {
      that.setData({
        showClass: false
      })
    }, 100)

      //请求接口，获取数据
  },

  /*******隐藏弹出面板********/
  hideGrey:function(){
    var that=this;
    that.setData({
      showClass:false
    })
  },
  bindscrolltoupper:function(){
    console.log("滑动到左边")
  },
  bindscrolltolower:function(){
    console.log("滑动到右边")
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})